/*
 * @Author: chenxin
 * @Date: 2020-11-09 14:45:32
 * @LastEditTime: 2021-03-20 22:08:51
 * @LastEditors: Please set LastEditors
 * @Description: 人员信息相关、部门相关、仓库相关、工作流相关、字典表相关
 * @FilePath: \cang-chu-guan-li-xi-tong\src\services\modules\common.js
 */
// 引入axios | 路径配置
import { AJAX_PATH } from "@/services/config.js";

// 导入 封装的 有权限请求2
import { HTTP_LIMITED } from "@/utils/axios.js";

class BeiHuoTongZhiHttp extends HTTP_LIMITED {
  // 备货通知申请
  StockNoticeSave(queryPath, data) {
    return this._post(AJAX_PATH.StockNoticeSave + queryPath, data);
  }

  // 出库单
  InOrOutStorageOrder(data) {
    return this._post(AJAX_PATH.InOrOutStorageOrder, data);
  }
  // 更新出入库单
  updateInOrOutStorageOrder(data) {
    return this._post(AJAX_PATH.updateInOrOutStorageOrder, data);
  }
  // 删除出入库单
  deleteInOrOutStorageOrder(queryPath) {
    return this._get(AJAX_PATH.deleteInOrOutStorageOrder + queryPath);
  }
  // 出库物品信息
  InOrOutStorageGoods(data) {
    return this._post(AJAX_PATH.InOrOutStorageGoods, data);
  }
  // 获取出入库列表
  getInOrOutStorageList(queryPath) {
    return this._get(AJAX_PATH.getInOrOutStorageList + queryPath);
  }
  // 获取出入库列表
  getInOrOutStorageOrderList(queryPath) {
    return this._get(AJAX_PATH.getInOrOutStorageOrderList + queryPath);
  }
  // 通过id获取出入库订单信息
  getInOrOutStorageInfoById(queryPath) {
    return this._get(AJAX_PATH.getInOrOutStorageInfoById + queryPath);
  }

  // 更新出入库物品信息
  updateInOrOutStorageGoods(data) {
    return this._post(AJAX_PATH.updateInOrOutStorageGoods, data);
  }
  // 根据 Id 进行查询的接口
  getStockNoticeGoodsList(queryPath){
    return this._post(AJAX_PATH.getStockNoticeGoodsList + queryPath);
  }

  // ------------------ 组装 ----------------------------

  // 新增组装单和物品信息
  saveAssemblyOrderAndGoods(data) {
    return this._post(AJAX_PATH.saveAssemblyOrderAndGoods, data);
  }

  // 更新组装单和物品信息
  updataAssemblyOrderAndGoods(data) {
    return this._post(AJAX_PATH.updataAssemblyOrderAndGoods, data);
  }
  // 新增组装物品信息
  saveAssemblyGoods(data) {
    return this._post(AJAX_PATH.saveAssemblyGoods, data);
  }

  // 更新组装单
  updataAssemblyOrder(data) {
    return this._post(AJAX_PATH.updataAssemblyOrder, data);
  }

  // 仅删除组装单和物品信息
  deleteAssemblyOrderAndGoods(queryPath) {
    return this._get(AJAX_PATH.deleteAssemblyOrderAndGoods + queryPath);
  }
  // 获取组装单和物品信息的列表
  getAssemblyOrderAndGoodsList(queryPath) {
    return this._get(AJAX_PATH.getAssemblyOrderAndGoodsList + queryPath);
  }
  // 删除组装物品信息
  deleteAssemblyGoods(queryPath) {
    return this._get(AJAX_PATH.deleteAssemblyGoods + queryPath);
  }

  // 通过组装单Id获取组装单和物品信息
  getAssemblyOrderAndGoodsById(queryPath) {
    return this._get(AJAX_PATH.getAssemblyOrderAndGoodsById + queryPath);
  }
  // 获取组装单Id和内容
  getAssemblyListAndId() {
    return this._get(AJAX_PATH.getAssemblyListAndId);
  }
}

export { BeiHuoTongZhiHttp };
